package com.xy.user.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.user.Employee;
import com.ruoyi.common.core.mapper.user.EmployeeMapper;
import com.ruoyi.common.core.utils.DateUtils;
import com.xy.user.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 服务人员Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-29
 */
@Service
public class EmployeeServiceImpl implements IEmployeeService
{
    @Autowired
    private EmployeeMapper employeeMapper;

    /**
     * 查询服务人员
     *
     * @param id 服务人员主键
     * @return 服务人员
     */
    @Override
    public Employee selectEmployeeById(String id)
    {
        return employeeMapper.selectEmployeeById(id);
    }

    /**
     * 查询服务人员列表
     *
     * @param employee 服务人员
     * @return 服务人员
     */
    @Override
    public List<Employee> selectEmployeeList(Employee employee)
    {
        return employeeMapper.selectEmployeeList(employee);
    }

    /**
     * 新增服务人员
     *
     * @param employee 服务人员
     * @return 结果
     */
    @Override
    public int insertEmployee(Employee employee)
    {
        employee.setCreateTime(DateUtils.getNowDate());
        return employeeMapper.insertEmployee(employee);
    }

    /**
     * 修改服务人员
     *
     * @param employee 服务人员
     * @return 结果
     */
    @Override
    public int updateEmployee(Employee employee)
    {
        return employeeMapper.updateEmployee(employee);
    }

    /**
     * 批量删除服务人员
     *
     * @param ids 需要删除的服务人员主键
     * @return 结果
     */
    @Override
    public int deleteEmployeeByIds(String[] ids)
    {
        return employeeMapper.deleteEmployeeByIds(ids);
    }

    /**
     * 删除服务人员信息
     *
     * @param id 服务人员主键
     * @return 结果
     */
    @Override
    public int deleteEmployeeById(String id)
    {
        return employeeMapper.deleteEmployeeById(id);
    }
}
